<?php

namespace app\index\command;

use think\console\Command;
use think\console\Input;
use think\console\Output;

class WxApi extends Command {

    protected function configure() {
        $this->setName('wxapi')->setDescription('Here is the remark ');
    }

    protected function execute(Input $input, Output $output) {
        $output->writeln("start");
        $redis = new \Redis();
 
        $redis->connect('127.0.0.1',6379);
        $i=1;
        while ($i>0) {
            //延迟 0.5秒
            usleep(500000);
            $value = $redis->lpop('mylist');
            $output->writeln($value) ;
        }
        $output->writeln("end");
    }

}
